package com.jsu.springboot_crop.dao;

import com.jsu.springboot_crop.entity.Finance;
import com.jsu.springboot_crop.entity.Intention;
import com.jsu.springboot_crop.entity.Recommend;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author wang
 * @Date 2023/8/25 19:37
 */
@Mapper
public interface FinanceDao {
    //个人贷款
    public void insertFinance(Finance finance);
    //组合贷款
    public void insertFinanceMulti(Finance finance);
    //查询个人融资
    public List<Finance> selectByFinance(Finance finance);
    //根据id查询融资
    public Finance selectByPrimaryKey(Integer financeId);
    //修改融资
    public int updateByPrimaryKeySelective(Finance finance);
    //删除融资
    public int deleteByPrimaryKey(Integer financeId);
    //查询融资意向
    public List<Intention> selectIntentionByName(String name);
    //修改融资意向
    public void updateIntentionByName(Intention intention);
    //添加融资意向
    public void insertIntentionByName(Intention intention);
    //删除融资意向
    public void deleteIntentionByName(String name);

    public Intention selectIntention(String name);

    public List<Recommend> selectRecommend(@Param("name") String name, @Param("product") String product);

    //查询推荐融资人:
        //有融资意向时
    public List<Recommend> selectWithNoneIntention(String item,Integer id);
        //无意向时
    public List<Recommend> selectAllRecommend(String name);
    //查询是否已经贷款
    public Finance selectIfApply(String name);

    public int selectAmountByName(String name);

    public String selectIntentionProductByName(String name);

}
